There are many environments in which a large amount of data may be gathered. In many cases, the data that is gathered is considered noisy, and a smoothed version of the data is desirable. For example, such smoothing may be desired when analyzing financial data such as stock prices, returns, or trading volumes, or economic data such as gross domestic product or employment statistics. As another example, a computer system that utilizes touch or gestures to receive user input may gather many data points as the user interacts with the system. Various sources of noise may affect the data that is gathered. For example, such a computer system may include a digitizer to convert analog touch or gesture data to digital data. Depending on the type of digitizer used, the digitizer may introduce varying degrees of noise.
Exponential Moving Average (EMA) is a recursive function that takes a weighted average of all sampled data points using a constant smoothing factor, α, having a value between zero and one. The most recently sampled data point is multiplied by the constant, α, and previously sampled data points are multiplied by successive powers of α. Because α is typically less than one, powers of α can quickly drop to negligible fractional percentages. In this way, less recent data points decay to negligible values quickly.
The value selected for α can significantly influence the results of data smoothing using EMA. When α is near one, the smoothed output is nearly the same as the raw input. When α is near zero, the smoothed output has high latency and responds weakly to changes in input trends.